
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('open_my_utilities')) {
	function open_my_utilities() {
		return null;	
	}
		
	function format_currency($strCurr) {		
		$rev = strrev($strCurr);
		$length = strlen($rev);
		$retRev = "";
		for($i = 0; $i < $length ; $i++) {
			$retRev .= $rev[$i];
			if (($i != $length-1) && ($i % 3 == 2) ) {
				$retRev .= ",";
			}
		}
		return strrev($retRev);
	}
			
	function getNameFromDesc($desc) {
		$arr = explode('/',$desc);
		return trim($arr[0],' ');
	}
	function getColorFromDesc($desc) {
		$arr = explode('/',$desc);
		return trim($arr[1],' ');
	}

	//TODO: document load helper date
	function getDateToday($datestring="%Y/%m/%d") {
		$today = mdate($datestring,now());
		return $today;
	}
	
	function getRidComma($str) {
		return str_replace(',','',$str);
	}
}
?>